Skip to content

Support DelayedMessageWrapper Deserialized #9561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

NaccOll
Copy link
Contributor

@NaccOll NaccOll commented Oct 19, 2024

DelayedMessageWrapper cannot be deserialized when using RedisMessageStore and JSON serialization

org.springframework.data.redis.serializer.SerializationException: Could not read JSON:Cannot construct instance of `org.springframework.integration.handler.DelayHandler$DelayedMessageWrapper` (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
 at [Source: UNKNOWN; byte offset: #UNKNOWN] 
	at org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer.deserialize(GenericJackson2JsonRedisSerializer.java:311)
	at org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer.deserialize(GenericJackson2JsonRedisSerializer.java:281)
	at org.springframework.data.redis.serializer.SerializationUtils.deserializeValues(SerializationUtils.java:54)
	at org.springframework.data.redis.serializer.SerializationUtils.deserialize(SerializationUtils.java:68)
	at org.springframework.data.redis.core.AbstractOperations.deserializeValues(AbstractOperations.java:306)
	at org.springframework.data.redis.core.DefaultListOperations.lambda$range$9(DefaultListOperations.java:159)
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:411)
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:378)
	at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:117)
	at org.springframework.data.redis.core.DefaultListOperations.range(DefaultListOperations.java:159)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.springframework.data.redis.core.BoundOperationsProxyFactory$BoundOperationsMethodInterceptor.doInvoke(BoundOperationsProxyFactory.java:177)
	at org.springframework.data.redis.core.BoundOperationsProxyFactory$BoundOperationsMethodInterceptor.invoke(BoundOperationsProxyFactory.java:148)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
	at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:69)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:223)

@NaccOll NaccOll force-pushed the hotfix_delay_message_not_deserializer_in_redis branch from e36bc1e to 2768d25 Compare October 19, 2024 01:50
Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for spotting this and fixing!
Please, find my review.
And we are agreed, it could be incorporated into tomorrow's releases.

@NaccOll
Copy link
Contributor Author

NaccOll commented Oct 21, 2024

@artembilan Modified, request merge

@NaccOll NaccOll force-pushed the hotfix_delay_message_not_deserializer_in_redis branch from 4325fc0 to e16928d Compare October 22, 2024 00:12
Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
I’ll run merge and back-port tomorrow before release .
Thank you!

spring-builds pushed a commit that referenced this pull request Oct 22, 2024
Fixes: #9561
PR: #9561

The `DelayHandler.DelayedMessageWrapper` cannot be deserialized when using `RedisMessageStore` and JSON serialization:
```
org.springframework.data.redis.serializer.SerializationException: Could not read JSON:Cannot construct instance of `org.springframework.integration.handler.DelayHandler$DelayedMessageWrapper` (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
 at [Source: UNKNOWN; byte offset: #UNKNOWN]
	at org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer.deserialize(GenericJackson2JsonRedisSerializer.java:311)
```

* More code clean up and refactoring in the test

(cherry picked from commit 73bb813)
spring-builds pushed a commit that referenced this pull request Oct 22, 2024
Fixes: #9561
PR: #9561

The `DelayHandler.DelayedMessageWrapper` cannot be deserialized when using `RedisMessageStore` and JSON serialization:
```
org.springframework.data.redis.serializer.SerializationException: Could not read JSON:Cannot construct instance of `org.springframework.integration.handler.DelayHandler$DelayedMessageWrapper` (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
 at [Source: UNKNOWN; byte offset: #UNKNOWN]
	at org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer.deserialize(GenericJackson2JsonRedisSerializer.java:311)
```

* More code clean up and refactoring in the test

(cherry picked from commit 73bb813)
@artembilan
Copy link
Member

@NaccOll ,

Thank you for contribution!
Merged and back-ported.
Couple support versions are going to be released today.

One remark:
Don't squash commits for better review history.
Then I'll look into only new changes since the previous commit.
The first commit message becomes PR description: saves some typing time, plus all the info is going to be there in the commit history.
Make yourself familiar with this article to understand importance of the commit message and the whole history process: https://cbea.ms/git-commit/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants